<?php

/**
 * Escalaespecial form base class.
 *
 * @method Escalaespecial getObject() Returns the current form's model object
 *
 * @package    SistemaRutasEc
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseEscalaespecialForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_ee'         => new sfWidgetFormInputHidden(),
      'id_ru'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Ruta'), 'add_empty' => false)),
      'ciudad'        => new sfWidgetFormInputText(),
      'distancia'     => new sfWidgetFormInputText(),
      'costonormal'   => new sfWidgetFormInputText(),
      'costoespecial' => new sfWidgetFormInputText(),
      'activo'        => new sfWidgetFormInputCheckbox(),
    ));

    $this->setValidators(array(
      'id_ee'         => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id_ee')), 'empty_value' => $this->getObject()->get('id_ee'), 'required' => false)),
      'id_ru'         => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Ruta'))),
      'ciudad'        => new sfValidatorString(array('max_length' => 255)),
      'distancia'     => new sfValidatorInteger(),
      'costonormal'   => new sfValidatorPass(),
      'costoespecial' => new sfValidatorPass(),
      'activo'        => new sfValidatorBoolean(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('escalaespecial[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Escalaespecial';
  }

}
